var http = require('http'),
    url = require('url'),
    router = require('./router');

//路由改造
http.createServer(function(req, res) {
    if (req.url != "/favicon.ico") { //清除第2此访问      
        var pathname = url.parse(req.url).pathname;
        pathname = pathname.replace(/\//, ''); //替换掉前面的/
        router[pathname](req, res);
    }
}).listen(8000);
console.log('Server running at http://127.0.0.1:8000/');